Add follow/unfollow commands to ax#1
Open
podthesquire wants to merge 1 commit into
Open
Conversation
Add and to the agent-x Twitter/X CLI. Changes: - src/cli/self_ops.rs: Add Follow/Unfollow variants to SelfAction enum - src/api/self_ops.rs: Add follow_user/unfollow_user XClient methods - src/api/users.rs: Make resolve_user_id pub for cross-impl use - src/cli/mod.rs: Update Self doc comment - src/main.rs: Add Follow/Unfollow dispatch in handle_self() - tests/cli_test.rs: Add 3 tests (help includes follow, follow no-auth, unfollow no-auth) - README.md: Update command tree - skills/agent-x/SKILL.md: Update command tree X API v2 endpoints: POST /2/users/:id/following → follows a user DELETE /2/users/:id/following/:target → unfollows a user Both resolve usernames to user IDs automatically. Uses MutationResult for consistent output formatting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
ax self follow <username>andax self unfollow <username>commands to the agent-x CLI, following the same pattern as existing self-ops (like/unlike, retweet/unretweet, bookmark/unbookmark).Changes
src/cli/self_ops.rsFollow/Unfollowvariants toSelfActionenumsrc/api/self_ops.rsfollow_user()/unfollow_user()XClient methodssrc/api/users.rsresolve_user_id()pub for cross-impl accesssrc/cli/mod.rsselfcommand descriptionsrc/main.rshandle_self()tests/cli_test.rsREADME.mdskills/agent-x/SKILL.mdAPI
POST /2/users/:id/followingwith{"target_user_id": "..."}DELETE /2/users/:id/following/:target_user_idBoth resolve usernames to user IDs automatically (supports @handle or raw ID).
Tests
All existing + new tests pass. Pre-existing
test_auth_status_no_authfailure is environment-specific (machine has stored OAuth2 tokens).